﻿/* 自定义的WinKawaks的通用热键模块,最后导出MyWinKawaks_setHotkeys()函数,执行该函数才会使用热键设定
  By setycyas @2022-11-09
*/

/* 内部函数定义 
*/

;暂停与开始
__MyWinKawaks_pauseToggle(){
  send {enter down}{enter up}
}

;静音切换
__MyWinKawaks_soundToggle(){
  SoundSet, +1, , Mute ;说明书里面的实例,切换静音状态
}

;即时存档
__MyWinKawaks_stateSave(){
  send, {F5 down}{F5 up}
}

;即时读档
__MyWinKawaks_stateLoad(){
  send, {F7 down}{F7 up}
}

/* 导出函数MyWinKawaks_setHotkeys(),使用则设定热键
*/
MyWinKawaks_setHotkeys(){
  Hotkey, IfWinActive, ahk_exe WinKawaks.exe
  Hotkey, ~numpad0, __MyWinKawaks_pauseToggle
  Hotkey, ~numpad1, __MyWinKawaks_soundToggle
  Hotkey, ~Delete, __MyWinKawaks_stateSave
  Hotkey, ~PGDN, __MyWinKawaks_stateLoad
  Hotkey, IfWinActive
}